package p2000;

import java.util.Scanner;

public class Main2011多项式求和 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int t = scanner.nextInt();
        while (t-- > 0) {
            int n = scanner.nextInt();
            double sum = 0;
            for (int i = 1; i <= n; i++) {
                if (i % 2 == 1) {
                    sum += 1D / i;
                } else {
                    sum -= 1D / i;
                }
            }
            System.out.println(String.format("%.2f", sum));
        }
    }

}
